package com.dts.evaluate.utils;

import android.util.Log;

/**
 * Created by user on 2016/7/1.
 */
public class LogUtil {

    public static boolean flag = true;

    /**
     * 初始化LogUtil
     * @param open  true,打开日志， false关闭日志
     */
    public static void init(boolean open){
        flag = open;
    }



    public static void d(Object object,String msg){
        if(flag) {
            String tag = object.getClass().getName();
            Log.d(tag, msg);
        }
    }

    public static void v(Object object,String msg){
        if(flag) {
            String tag = object.getClass().getName();
            Log.v(tag, msg);
        }
    }
    /**
     * 默认tag为字符串“tag”
     * @param msg
     */
    public static void v(String msg){
        if(flag){
            Log.v("tag",msg);
        }
    }

    public static void e(Object object,String msg){
        if(flag) {
            String tag = object.getClass().getName();
            Log.e(tag, msg);
        }
    }
    /**
     * 默认tag为字符串“tag”
     * @param msg
     */
    public static void e(String msg){
        if(flag){
            Log.e("tag",msg);
        }
    }

    public static void i(Object object,String msg){
        if(flag) {
            String tag = object.getClass().getName();
            Log.i(tag, msg);
        }
    }

    public static void w(Object object,String msg){
        if(flag) {
            String tag = object.getClass().getName();
            Log.w(tag, msg);
        }
    }


}
